<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateMessagesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('messages', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('pull_id')->comment('接受消息的用户id');
            $table->integer('post_id')->comment('接受消息的用户的文章id');
            $table->integer('push_id')->comment('发送消息的用户id');
            $table->tinyInteger('status')->comment('消息状态');
            $table->tinyInteger('read')->comment('阅读状态');
            $table->string('msg')->commeny('消息内容');
            $table->string('feedback')->comment('反馈与审核信息')->default('0');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('messages');
    }
}
